//
//  CustomTabBarController.swift
//  FaceBook
//
//  Created by 劢克科技 on 2019/2/12.
//  Copyright © 2019 劢克科技. All rights reserved.
//

import UIKit

class CustomTabBarController: UITabBarController {

    override func viewDidLoad() {
        super.viewDidLoad()

        let home = MainNavController(rootViewController: TableViewController())
        home.tabBarItem.image = #imageLiteral(resourceName: "news")
        home.title = "News"
        
        let peoples = MainNavController(rootViewController: UIViewController())
        peoples.tabBarItem.image = #imageLiteral(resourceName: "users")
        peoples.title = "Peoples"
        
        let message = MainNavController(rootViewController: UIViewController())
        message.tabBarItem.image = #imageLiteral(resourceName: "xiaoxi")
        message.title = "Message"
        
        let global = MainNavController(rootViewController: UIViewController())
        global.tabBarItem.image = #imageLiteral(resourceName: "global")
        global.title = "Global"
        
        let more = MainNavController(rootViewController: UIViewController())
        more.tabBarItem.image = #imageLiteral(resourceName: "more")
        more.title = "More"
        
        viewControllers = [home, peoples, message, global, more]
        tabBar.isTranslucent = false
        tabBar.clipsToBounds = true
        
        let topBorder = CALayer()
        topBorder.frame = CGRect(x: 0, y: 0, width: 1000, height: 0.5)
        topBorder.backgroundColor = #colorLiteral(red: 0.8039215803, green: 0.8039215803, blue: 0.8039215803, alpha: 1)
        tabBar.layer.addSublayer(topBorder)
    }
}
